UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pEIrOpConZQFPfQEIZQeyhWNItJLrXIAjAVNUtz6ya8='
WHERE
key_id = '33e9aee27341a11354a4b6bfdf63dcb036b0e1c9c44318ecadb39ab076333e75'
AND (
token = 'pEIrOpConZQFPfQEIZQeyhWNItJLrXIAjAVNUtz6ya8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)