UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9ihFiPTNNpvivr0ZzyN3pqNrAPFk66vHyMgRAfmJJBA=' 
WHERE 
  key_id = '35f430a2d8c2b09c20504a1fb1049fef476be531a8ba3eb63e4c8aa48a64d1ab' 
  AND (
    token = '9ihFiPTNNpvivr0ZzyN3pqNrAPFk66vHyMgRAfmJJBA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020