UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YZDe0zZU7mkG/SsB0ESL9kV8CqTGoE0dnkVYv4UvmKw='
WHERE
key_id = '37476a83a2f66dbbdb3e37a4fc20d3f3172f967382f49c75774949a880fca037'
AND (
token = 'YZDe0zZU7mkG/SsB0ESL9kV8CqTGoE0dnkVYv4UvmKw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)