UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2mv+QB2in65mF5kANQl4wji7mWRERwezwifB1OeQmYQ='
WHERE
key_id = '524916e472b8812cd5657c557f2a3b0f487c5772d77e74f7823c842bac96d175'
AND (
token = '2mv+QB2in65mF5kANQl4wji7mWRERwezwifB1OeQmYQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)