UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6LJGkKQITC34YFlDPYlxxsOjWkg/5Yk6A7BmNgGovLk=' 
WHERE 
  key_id = 'd236348b4473eb963e6199c1928b51de51b7b9ff7599b8ae3c62e59d49d9109b' 
  AND (
    token = '6LJGkKQITC34YFlDPYlxxsOjWkg/5Yk6A7BmNgGovLk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019