UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZX8hKuWU2fe1BWgcxqbnUz1l+CDjBJ/C3JK17lnfXQQ=' 
WHERE 
  key_id = '6b10902da5578e6e11cb740653ebac59480370c11196a05cf02fba206789c1ff' 
  AND (
    token = 'ZX8hKuWU2fe1BWgcxqbnUz1l+CDjBJ/C3JK17lnfXQQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043