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