UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nOKgB9bx/IpAghQK03jmIsfSUlVMBxlumkjzf/VveX0=' 
WHERE 
  key_id = '9d6d6b244cdcd6df0ac30fc4b2063d0a4573a00ef510a83ebe873ea595be951d' 
  AND (
    token = 'nOKgB9bx/IpAghQK03jmIsfSUlVMBxlumkjzf/VveX0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030