UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1XvP/ESLeAsH7tIXMxLwE2cYrnWgUuga/GrTvPDMYlo='
WHERE
key_id = '961f2f2a73fb58618c78fa979e6839e07d930587e4a54dcf59ef124dc05deffc'
AND (
token = '1XvP/ESLeAsH7tIXMxLwE2cYrnWgUuga/GrTvPDMYlo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)