UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5HtJgqUpDvSIgnV7hDb7eOh01i02bmzY6hB8Od02MUo='
WHERE
key_id = 'a7619fd1f03dbb26faed6de62d76a4ac8f5ac6a873a543478a3145766078a040'
AND (
token = '5HtJgqUpDvSIgnV7hDb7eOh01i02bmzY6hB8Od02MUo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)