UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GOGex8faMrvwYwZoPonQN7cjxyFsWYzXKr20eIIG8JA='
WHERE
key_id = 'd8f721aa96691e6b0f4d989440c11096f829253c693f22d06920858f8adf0a1e'
AND (
token = 'GOGex8faMrvwYwZoPonQN7cjxyFsWYzXKr20eIIG8JA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)