UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/MJ8bwJRpuddZ/ooDtH7li/59YGmRJqRLr7v/2UdhaI=' 
WHERE 
  key_id = '1fb355753c11007860541d8847aa54a05a44d78e7ac7a8b892b8858f6f1cfce9' 
  AND (
    token = '/MJ8bwJRpuddZ/ooDtH7li/59YGmRJqRLr7v/2UdhaI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044