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