UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '86mykJ3Kbx9ypS3G9PH3b7ga7hAzDe9THbTe842EanU='
WHERE
key_id = '1aa26cd8b68e0603822c61cd65c6439a39e1692b32927c6eadb6935cdfe97983'
AND (
token = '86mykJ3Kbx9ypS3G9PH3b7ga7hAzDe9THbTe842EanU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)