UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZWBVgzTN3ExYT1A/pntTidWTqDPoNcZBBO25Cyupkqc='
WHERE
key_id = '6b308c336d2e1975ff639aba217bee42547bc4af3f28dec7a7428a0f04a62e9f'
AND (
token = 'ZWBVgzTN3ExYT1A/pntTidWTqDPoNcZBBO25Cyupkqc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)