UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1/fRUYQWQ8KDmh5UnMvP3GMJH/AEgLlsQClJx6t8XJw=' 
WHERE 
  key_id = '7629e786f1dca4b82926459f2c04d8a72bf6fef80b21f4b632c31df1cfb4909b' 
  AND (
    token = '1/fRUYQWQ8KDmh5UnMvP3GMJH/AEgLlsQClJx6t8XJw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043