UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oOTtqjrbo3L5AQBTrKBa/7oCqw6tRoeP+m+SfO7x3Hg='
WHERE
key_id = 'e275669546ae955b11272031555693da017073b47247c37abac62548d1755ab2'
AND (
token = 'oOTtqjrbo3L5AQBTrKBa/7oCqw6tRoeP+m+SfO7x3Hg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)