UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3XIw6obzL9BS6Rc8TM8rNXrf+qx94VANBwKuVdNmlyY='
WHERE
key_id = 'e20cdb3fadfb51a68fa52896b816d9267fd187cdd3fe60799796ce9eb0f8a73d'
AND (
token = '3XIw6obzL9BS6Rc8TM8rNXrf+qx94VANBwKuVdNmlyY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)