UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kseqNHmNokiVz3y6InH1U6e+dM4kPpSmt9btiaCB7zw='
WHERE
key_id = 'cd3b3dbcc7f6cfb3a937cb394069342f7a4265e903922fe039b18abec3b2bafe'
AND (
token = 'kseqNHmNokiVz3y6InH1U6e+dM4kPpSmt9btiaCB7zw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)