UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pkqk19PPL0S1M8GKYFKMpNu9gI1/B79TXtkiP0GRFcY=' 
WHERE 
  key_id = '938633d4ba03c19251dc83ff55e46cab25ccc3ff1175810d5b877a3389f6f8f8' 
  AND (
    token = 'pkqk19PPL0S1M8GKYFKMpNu9gI1/B79TXtkiP0GRFcY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024