UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8UyyDpt+sGbqpydfJ1ZMo6UvlsQ8uD9wppXVRpTmF2k='
WHERE
key_id = '7c4f10bca95da5a8aa83c6a005417e92d5523a0ee403cac16bd877cae482deae'
AND (
token = '8UyyDpt+sGbqpydfJ1ZMo6UvlsQ8uD9wppXVRpTmF2k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)