UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qvc50SQ2J7U7o/P8R6E7vG0XmJajlRTRKAbE7P2Am5A='
WHERE
key_id = 'ced258ea8d89b601a3ae1d27c9fa21f0a18f696daa4acce3e7f6c6ddaa505667'
AND (
token = 'qvc50SQ2J7U7o/P8R6E7vG0XmJajlRTRKAbE7P2Am5A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)