UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RuRDYQlmHHyrr2qJnHlAb8j2LAVJN8Qjm+XlMoDY3gc='
WHERE
key_id = 'fe7d0e4f2c26d7ea1373411dbaa26f42123c4870d699cdfa6f935e7c10674a66'
AND (
token = 'RuRDYQlmHHyrr2qJnHlAb8j2LAVJN8Qjm+XlMoDY3gc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)