UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+Qmsq0CGHbxRy9hXDqOzU+MzIQPugRFbLNE6elHMMoE='
WHERE
key_id = '8f3a9dfffa610fa6f39d14fd795807aac9943709199f5f6df374c9f3c2886b31'
AND (
token = '+Qmsq0CGHbxRy9hXDqOzU+MzIQPugRFbLNE6elHMMoE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)