UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cW2h491XPAzsNEgCBr811ct/55YJ65aHLy0GR+qvzWE='
WHERE
key_id = '89018c0f9ad51c166d90b445d35bb64752e60a730ab08c9e4914850ade663b21'
AND (
token = 'cW2h491XPAzsNEgCBr811ct/55YJ65aHLy0GR+qvzWE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)