UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BSSBu1oGfhfrut6WepZkcN3bdJv6e+xSmK9E7oM0x4c=' 
WHERE 
  key_id = 'b0ba887ea4aae25e1b85c291a14406f8b876356e2552aa1726846515750aa8b2' 
  AND (
    token = 'BSSBu1oGfhfrut6WepZkcN3bdJv6e+xSmK9E7oM0x4c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027