UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L86iIhvsuwlotfLWXBk8YGhbrPV6CtiW2VWGdsRdBuU='
WHERE
key_id = '2455bff71f6264de5485ca8ee052aaee83af41e3ce44a73d2a05ae7f04954c59'
AND (
token = 'L86iIhvsuwlotfLWXBk8YGhbrPV6CtiW2VWGdsRdBuU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)