UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oI3nXl+gSGIrho7qAx8/ZG76cIfLRtlc3DyanHKRJiE='
WHERE
key_id = '36fe89413a19df18a2b2fcf8c8f4e1a87711a84829ceaf256543e2fb6c3a13a5'
AND (
token = 'oI3nXl+gSGIrho7qAx8/ZG76cIfLRtlc3DyanHKRJiE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)