UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FF4rKiPkFGtEuPr5svvfc9YSyx9m1Nq9usGpo0aYJis=' 
WHERE 
  key_id = 'cc49bbb2b237ad702675e8cd170a8b9aea958275654bc58721054c7bbfcd0bbc' 
  AND (
    token = 'FF4rKiPkFGtEuPr5svvfc9YSyx9m1Nq9usGpo0aYJis=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026