UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gZ4oCTsfcspZL4RFNsbJWANpn4wYd6LM2XvMqH9Engc='
WHERE
key_id = '3b594c1823bfe4d86c81c7393bba98fd35d30af9c3dea7facc90bfff1d2c3908'
AND (
token = 'gZ4oCTsfcspZL4RFNsbJWANpn4wYd6LM2XvMqH9Engc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)