UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SXEkDOKVLyuPcwaKxHNyc1jOfCGL2SgZKhLUwBEfTUI=' 
WHERE 
  key_id = '2554084b306d61dc773b33d3697a999572788237cc93a7bad40a3a3dfb2adc61' 
  AND (
    token = 'SXEkDOKVLyuPcwaKxHNyc1jOfCGL2SgZKhLUwBEfTUI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028