UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+2rHbCkqGFherjjgmIPNpf63BAgEbB/gwhQX0FafqI0=' 
WHERE 
  key_id = 'e32cd0b9b974193b4d81f546c25a2971ae11e7270cdfa160011fa993b2e2a2da' 
  AND (
    token = '+2rHbCkqGFherjjgmIPNpf63BAgEbB/gwhQX0FafqI0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022