UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6Ypmie38Etwnh1aXeyX7cONz6rzwOvKIX4TmqXyCRkM='
WHERE
key_id = 'eb03f129e69c123781bba90fc9fbf3e7fdd6e232ee41cf5ace962395c73e0880'
AND (
token = '6Ypmie38Etwnh1aXeyX7cONz6rzwOvKIX4TmqXyCRkM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)